Pyramids - Limin DingΒΆ
What is Image Pyramid?ΒΆ
Image pyramid is constructed by a series of subsampling operations applied to an image sequentially, which captures image information at multiple scales
Gaussian Pyramid
Gaussian Pyramid is the representative method to build a multi-scale representation of an image. It consists of two steps: (1)smoothing to remove high-frequency components that could result aliasing, and (2)down-sampling: reduce the image size by half.
import numpy as np
import matplotlib.pyplot as plt
from skimage import data
from skimage.transform import pyramid_gaussian
image = data.astronaut()
rows, cols, dim = image.shape
pyramid = tuple(pyramid_gaussian(image, downscale=2, channel_axis=-1))
# determine the total number of rows and columns for the composite
composite_rows = max(rows, sum(p.shape[0] for p in pyramid[1:]))
composite_cols = cols + pyramid[1].shape[1]
composite_image = np.zeros((composite_rows, composite_cols, 3),
dtype=np.double)
# store the original to the left
composite_image[:rows, :cols, :] = pyramid[0]
# stack all downsampled images in a column to the right of the original
i_row = 0
for p in pyramid[1:]:
n_rows, n_cols = p.shape[:2]
composite_image[i_row:i_row + n_rows, cols:cols + n_cols] = p
i_row += n_rows
fig, ax = plt.subplots()
ax.imshow(composite_image)
plt.show()
Laplacian Pyramid
Laplacian Pyramids are formed from the Gaussian Pyramids. A level in Laplacian Pyramid is formed by the difference between that level in Gaussian Pyramid and expanded version of its upper level in Gaussian Pyramid. A Laplacian pyramid is very similar to a Gaussian pyramid but saves the difference image of the blurred versions between each levels.
import numpy as np
import matplotlib.pyplot as plt
from skimage import data
from skimage.transform import pyramid_gaussian, pyramid_laplacian
image = data.astronaut()
rows, cols, dim = image.shape
pyramid = tuple(pyramid_gaussian(image, downscale=2, channel_axis=-1))
laplacian_pyramid = tuple(pyramid_laplacian(image, downscale=2, channel_axis=-1))
# determine the total number of rows and columns for the composite
composite_rows = max(rows, sum(p.shape[0] for p in laplacian_pyramid[1:]))
composite_cols = cols + laplacian_pyramid[1].shape[1]
composite_image = np.zeros((composite_rows, composite_cols, 3),
dtype=np.double)
# store the original to the left
composite_image[:rows, :cols, :] = laplacian_pyramid[0] * 5
# stack all downsampled images in a column to the right of the original
i_row = 0
for p in laplacian_pyramid[1:]:
n_rows, n_cols = p.shape[:2]
composite_image[i_row:i_row + n_rows, cols:cols + n_cols] = p * 5
i_row += n_rows
fig, ax = plt.subplots()
ax.imshow(composite_image)
plt.show()
WARNING:matplotlib.image:Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
Image Blending
- Build Laplacian Pyramid LA and LB from images A and B.
- Build a Gaussian Pyramid GM from the selected Mask.
- Form a combine pyramid LS from LA and LB to get using the mask GM as weight.
- $LS = GM(i,j)*LA(i,j)+(1-GM(i,j))*LB(i,j)$
- Collapse the LS pyramid to get the final image.
from google.colab import files
uploadImg = files.upload()
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) /home/skim945/ece278a/topics/pyramid/ECE278A_Pyramid.ipynb Cell 21 line 1 ----> <a href='vscode-notebook-cell://wsl%2Bubuntu/home/skim945/ece278a/topics/pyramid/ECE278A_Pyramid.ipynb#X66sdnNjb2RlLXJlbW90ZQ%3D%3D?line=0'>1</a> from google.colab import files <a href='vscode-notebook-cell://wsl%2Bubuntu/home/skim945/ece278a/topics/pyramid/ECE278A_Pyramid.ipynb#X66sdnNjb2RlLXJlbW90ZQ%3D%3D?line=1'>2</a> uploadImg = files.upload() ModuleNotFoundError: No module named 'google'
# install the libraries
import numpy as np
import scipy.signal as sig
from scipy import misc
import matplotlib.pyplot as plt
from scipy import ndimage
import cv2
import imageio
from google.colab.patches import cv2_imshow
# create a Binomial (5-tap) filter
kernel = (1.0/256)*np.array([[1, 4, 6, 4, 1],[4, 16, 24, 16, 4],[6, 24, 36, 24, 6],[4, 16, 24, 16, 4],[1, 4, 6, 4, 1]])
"""
plt.imshow(kernel)
plt.show()
"""
def interpolate(image):
"""
Interpolates an image with upsampling rate r=2.
"""
image_up = np.zeros((2*image.shape[0], 2*image.shape[1]))
# Upsample
image_up[::2, ::2] = image
# Blur (we need to scale this up since the kernel has unit area)
# (The length and width are both doubled, so the area is quadrupled)
#return sig.convolve2d(image_up, 4*kernel, 'same')
return ndimage.filters.convolve(image_up,4*kernel, mode='constant')
def decimate(image):
"""
Decimates an image with downsampling rate r=2.
"""
# Blur
#image_blur = sig.convolve2d(image, kernel, 'same')
# print(np.shape(image), np.shape(kernel))
image_blur = ndimage.filters.convolve(image,kernel, mode='constant')
# Downsample
return image_blur[::2, ::2]
# here is the constructions of pyramids
def pyramids(image):
"""
Constructs Gaussian and Laplacian pyramids.
Parameters :
image : the original image (i.e. base of the pyramid)
Returns :
G : the Gaussian pyramid
L : the Laplacian pyramid
"""
# Initialize pyramids
G = [image, ]
L = []
# Build the Gaussian pyramid to maximum depth
while image.shape[0] >= 2 and image.shape[1] >= 2:
image = decimate(image)
G.append(image)
# Build the Laplacian pyramid
for i in range(len(G) - 1):
L.append(G[i] - interpolate(G[i + 1]))
return G[:-1], L
# [G, L] = pyramids(image)
# Build Gaussian pyramid and Laplacian pyramids from images A and B, also mask
# Reference: https://becominghuman.ai/image-blending-using-laplacian-pyramids-2f8e9982077f
def pyramidBlending(A, B, mask):
[GA, LA] = pyramids(A)
[GB ,LB] = pyramids(B)
# Build a Gaussian pyramid GR from selected region R (mask that says which pixels come from left and which from right)
[Gmask, LMask] = pyramids(mask)
# Form a combined pyramid LS from LA and LB using nodes of GR as weights
# Equation: LS(i, j) = GR(I, j)*LA(I, j) + (1-GR(I, j)* LB(I, j))
# Collapse the LS pyramid to get the final blended image
blend = []
for i in range(len(LA)):
# LS = np.max(Gmask[i])*LA[i] + (1-np.max(Gmask[i]))*LB[i]
# make sure the color with in 255 (white)
LS = Gmask[i]/255*LA[i] + (1-Gmask[i]/255)*LB[i]
blend.append(LS)
return blend
# reconstruct the pyramids as well as upsampling and add up with each level
def reconstruct(pyramid):
rows, cols = pyramid[0].shape
res = np.zeros((rows, cols + cols//2), dtype= np.double)
# start the smallest pyramid so we need to reverse the order
revPyramid = pyramid[::-1]
stack = revPyramid[0]
# start with the second index
for i in range(1, len(revPyramid)):
stack = interpolate(stack) + revPyramid[i] # upsampling simultaneously
return stack
# https://compvisionlab.wordpress.com/2013/05/13/image-blending-using-pyramid/
# Besides pyramid Blending, we need to blend image's color
def colorBlending(img1, img2, mask):
# split to 3 basic color, then using pyramidBlending and reconstruct it, respectively
img1R,img1G,img1B = cv2.split(img1)
img2R,img2G,img2B = cv2.split(img2)
R = reconstruct(pyramidBlending(img1R, img2R, mask))
G = reconstruct(pyramidBlending(img1G, img2G, mask))
B = reconstruct(pyramidBlending(img1B, img2B, mask))
output = cv2.merge((R, G, B))
print(output.shape)
output = output.astype(np.uint8)
# cv2.imwrite("output.png", output)
imageio.imsave("output.png", output)
img = cv2.imread("output.png")
cv2_imshow(img)
apple = imageio.imread('apple.jpg')
orange = imageio.imread('orange.jpg')
mask = cv2.imread('mask.jpg', 0)
colorBlending(orange,apple, mask)
Original ImageΒΆ
Original ImageΒΆ
Result ImageΒΆ
SIFT - Scale Invariant Feature Transform
Step 1 : Finding points of interest
- For each scale, calculate multiple gaussian blurred images.
- Then calculate the difference between each adjacent image to produce a DoG.
- Find the local maxima or minima points as the points of interest.
import matplotlib.pyplot as plt
from skimage import data
from skimage import transform
from skimage.color import rgb2gray
from skimage.feature import match_descriptors, plot_matches, SIFT
img1 = rgb2gray(data.astronaut())
img2 = transform.rotate(img1, 180)
tform = transform.AffineTransform(scale=(1.8, 1.6), rotation=0.5,
translation=(0, -200))
img3 = transform.warp(img1, tform)
descriptor_extractor = SIFT()
descriptor_extractor.detect_and_extract(img1)
keypoints1 = descriptor_extractor.keypoints
descriptors1 = descriptor_extractor.descriptors
descriptor_extractor.detect_and_extract(img2)
keypoints2 = descriptor_extractor.keypoints
descriptors2 = descriptor_extractor.descriptors
descriptor_extractor.detect_and_extract(img3)
keypoints3 = descriptor_extractor.keypoints
descriptors3 = descriptor_extractor.descriptors
matches12 = match_descriptors(descriptors1, descriptors2, max_ratio=0.6,
cross_check=True)
matches13 = match_descriptors(descriptors1, descriptors3, max_ratio=0.6,
cross_check=True)
fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(11, 8))
plt.gray()
# plot_matches(ax[0, 0], img1, img2, keypoints1, keypoints2, matches12)
# ax[0, 0].axis('off')
# ax[0, 0].set_title("Original Image vs. Flipped Image\n"
# "(all keypoints and matches)")
# plot_matches(ax[1, 0], img1, img3, keypoints1, keypoints3, matches13)
# ax[1, 0].axis('off')
# ax[1, 0].set_title("Original Image vs. Transformed Image\n"
# "(all keypoints and matches)")
plot_matches(ax[0], img1, img2, keypoints1, keypoints2, matches12[::15],
only_matches=True)
ax[0].axis('off')
ax[0].set_title("Original Image vs. Flipped Image\n"
"(subset of matches for visibility)")
plot_matches(ax[1], img1, img3, keypoints1, keypoints3, matches13[::15],
only_matches=True)
ax[1].axis('off')
ax[1].set_title("Original Image vs. Transformed Image\n"
"(subset of matches for visibility)")
plt.tight_layout()
plt.show()
Image Pyramid in Deep LearningΒΆ
FPN - Feature Pyramid Network
Recognizing objects at vastly different scales is a fundamental challenge in computer vision.
Feature pyramids built upon image pyramids form the basis of a standard solution
Using an image pyramid to build a feature pyramid. Features are computed on each of the image scales independently, which is very slow.
Recent detection systems have opted to use only single scale features for faster detection, but it might ignore small object information. Because the features of small-sized targets are rapidly lost with layer-by-layer downsampling, by the last layer there are very few features left to support accurate detection of small targets.
The structure adopted by SSD, which first proposed the idea of using Feature Map of different layers for detection. But SSD simply derives a prediction from each layer, it does not perform feature reuse between layers, so the improvement in the detection of small targets brought about is very limited.
A new approach to feature fusion, proposed by Facebook AI Research (FAIR) in "Feature Pyramid Networks for Object Detection", improves accuracy while maintaining a balance of speed.
The structure adopted by U-net is similar to the overall structure of (d), but the prediction is made only at the last layer.
YOLOv3
!git clone https://github.com/AlexeyAB/darknet
%cd darknet
!sed -i 's/OPENCV=0/OPENCV=1/' Makefile
!sed -i 's/GPU=0/GPU=1/' Makefile
!make
# Download the pre-trained weights for YOLOv3 and YOLOv2
!wget https://pjreddie.com/media/files/yolov3.weights
!wget https://pjreddie.com/media/files/yolov2.weights
import cv2
import subprocess
import matplotlib.pyplot as plt
# Function to perform detection
def detect_and_return_image(cfg, weights, image_path):
command = f"./darknet detect {cfg} {weights} {image_path} -dont-show"
!{command}
image = cv2.imread('predictions.jpg')
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # Convert to RGB
return image
# Load the pre-trained weights if not already done
!wget -nc https://pjreddie.com/media/files/yolov3.weights
!wget -nc https://pjreddie.com/media/files/yolov2.weights
# Assuming you have an image already in your workspace
image_path = '/content/bolivia-EAAS0224_trip7.jpg' # Path to your image
# Perform detection with YOLOv3 and YOLOv2
image_yolov3 = detect_and_return_image('cfg/yolov3.cfg', 'yolov3.weights', image_path)
image_yolov2 = detect_and_return_image('cfg/yolov2.cfg', 'yolov2.weights', image_path)
# Create a figure to display the results
plt.figure(figsize=(20, 10)) # Set the figure size to be large enough for both images
# Display YOLOv3 result
plt.subplot(1, 2, 1) # 1 row, 2 columns, first subplot
plt.imshow(image_yolov3)
plt.title('YOLOv3 Detection')
plt.axis('off') # Turn off axis labels
# Display YOLOv2 result
plt.subplot(1, 2, 2) # 1 row, 2 columns, second subplot
plt.imshow(image_yolov2)
plt.title('YOLOv2 Detection')
plt.axis('off') # Turn off axis labels
plt.show()
fatal: destination path 'darknet' already exists and is not an empty directory. [Errno 20] Not a directory: 'darknet' /content/darknet chmod +x *.sh g++ -std=c++11 -std=c++11 -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/image_opencv.cpp -o obj/image_opencv.o ./src/image_opencv.cpp: In function βvoid draw_detections_cv_v3(void**, detection*, int, float, char**, image**, int, int)β: ./src/image_opencv.cpp:945:23: warning: variable βrgbβ set but not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-but-set-variable-Wunused-but-set-variable]8;;] 945 | float rgb[3]; | ^~~ ./src/image_opencv.cpp: In function βvoid cv_draw_object(image, float*, int, int, int*, float*, int*, int, char**)β: ./src/image_opencv.cpp:1443:14: warning: unused variable βbuffβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1443 | char buff[100]; | ^~~~ ./src/image_opencv.cpp:1419:9: warning: unused variable βit_tb_resβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1419 | int it_tb_res = cv::createTrackbar(it_trackbar_name, window_name, &it_trackbar_value, 1000); | ^~~~~~~~~ ./src/image_opencv.cpp:1423:9: warning: unused variable βlr_tb_resβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1423 | int lr_tb_res = cv::createTrackbar(lr_trackbar_name, window_name, &lr_trackbar_value, 20); | ^~~~~~~~~ ./src/image_opencv.cpp:1427:9: warning: unused variable βcl_tb_resβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1427 | int cl_tb_res = cv::createTrackbar(cl_trackbar_name, window_name, &cl_trackbar_value, classes-1); | ^~~~~~~~~ ./src/image_opencv.cpp:1430:9: warning: unused variable βbo_tb_resβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1430 | int bo_tb_res = cv::createTrackbar(bo_trackbar_name, window_name, boxonly, 1); | ^~~~~~~~~ g++ -std=c++11 -std=c++11 -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/http_stream.cpp -o obj/http_stream.o ./src/http_stream.cpp: In member function βbool JSON_sender::write(const char*)β: ./src/http_stream.cpp:253:21: warning: unused variable βnβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 253 | int n = _write(client, outputbuf, outlen); | ^ ./src/http_stream.cpp: In function βvoid set_track_id(detection*, int, float, float, float, int, int, int)β: ./src/http_stream.cpp:866:27: warning: comparison of integer expressions of different signedness: βintβ and βstd::vector<detection_t>::size_typeβ {aka βlong unsigned intβ} []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare]8;;] 866 | for (int i = 0; i < v.size(); ++i) { | ~~^~~~~~~~~~ ./src/http_stream.cpp:874:33: warning: comparison of integer expressions of different signedness: βintβ and βstd::vector<detection_t>::size_typeβ {aka βlong unsigned intβ} []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare]8;;] 874 | for (int old_id = 0; old_id < old_dets.size(); ++old_id) { | ~~~~~~~^~~~~~~~~~~~~~~~~ ./src/http_stream.cpp:893:31: warning: comparison of integer expressions of different signedness: βintβ and βstd::vector<detection_t>::size_typeβ {aka βlong unsigned intβ} []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare]8;;] 893 | for (int index = 0; index < new_dets_num*old_dets.size(); ++index) { | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./src/http_stream.cpp:929:28: warning: comparison of integer expressions of different signedness: βstd::deque<std::vector<detection_t> >::size_typeβ {aka βlong unsigned intβ} and βintβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare]8;;] 929 | if (old_dets_dq.size() > deque_size) old_dets_dq.pop_front(); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/gemm.c -o obj/gemm.o ./src/gemm.c: In function βconvolution_2dβ: ./src/gemm.c:2042:15: warning: unused variable βout_wβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 2042 | const int out_w = (w + 2 * pad - ksize) / stride + 1; // output_width=input_width for stride=1 and pad=1 | ^~~~~ ./src/gemm.c:2041:15: warning: unused variable βout_hβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 2041 | const int out_h = (h + 2 * pad - ksize) / stride + 1; // output_height=input_height for stride=1 and pad=1 | ^~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/utils.c -o obj/utils.o ./src/utils.c: In function βcustom_hashβ: ./src/utils.c:1093:12: warning: suggest parentheses around assignment used as truth value []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wparentheses-Wparentheses]8;;] 1093 | while (c = *str++) | ^ In file included from /usr/include/string.h:535, from include/darknet.h:14, from ./src/utils.h:3, from ./src/utils.c:4: In function βstrncpyβ, inlined from βcopy_stringβ at ./src/utils.c:563:5: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:10: warning: β__builtin_strncpyβ specified bound depends on the length of the source argument []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wstringop-truncation-Wstringop-truncation]8;;] 95 | return __builtin___strncpy_chk (__dest, __src, __len, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 96 | __glibc_objsize (__dest)); | ~~~~~~~~~~~~~~~~~~~~~~~~~ ./src/utils.c: In function βcopy_stringβ: ./src/utils.c:563:22: note: length computed here 563 | strncpy(copy, s, strlen(s)+1); | ^~~~~~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/dark_cuda.c -o obj/dark_cuda.o ./src/dark_cuda.c: In function βcublas_check_error_extendedβ: ./src/dark_cuda.c:252:18: warning: comparison between βcudaError_tβ {aka βenum cudaErrorβ} and βenum cudaError_enumβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wenum-compare-Wenum-compare]8;;] 252 | if (status != CUDA_SUCCESS) | ^~ At top level: ./src/dark_cuda.c:275:23: warning: βswitchBlasHandleβ defined but not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 275 | static cublasHandle_t switchBlasHandle[16]; | ^~~~~~~~~~~~~~~~ ./src/dark_cuda.c:274:12: warning: βswitchBlasInitβ defined but not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 274 | static int switchBlasInit[16] = { 0 }; | ^~~~~~~~~~~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/convolutional_layer.c -o obj/convolutional_layer.o ./src/convolutional_layer.c: In function βforward_convolutional_layerβ: ./src/convolutional_layer.c:1335:32: warning: unused variable βt_intput_sizeβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1335 | size_t t_intput_size = binary_transpose_align_input(k, n, state.workspace, &l.t_bit_input, ldb_align, l.bit_align); | ^~~~~~~~~~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/list.c -o obj/list.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/image.c -o obj/image.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/activations.c -o obj/activations.o ./src/activations.c: In function βactivateβ: ./src/activations.c:79:5: warning: enumeration value βRELU6β not handled in switch []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wswitch-Wswitch]8;;] 79 | switch(a){ | ^~~~~~ ./src/activations.c:79:5: warning: enumeration value βSWISHβ not handled in switch []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wswitch-Wswitch]8;;] ./src/activations.c:79:5: warning: enumeration value βMISHβ not handled in switch []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wswitch-Wswitch]8;;] ./src/activations.c:79:5: warning: enumeration value βHARD_MISHβ not handled in switch []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wswitch-Wswitch]8;;] ./src/activations.c:79:5: warning: enumeration value βNORM_CHANβ not handled in switch []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wswitch-Wswitch]8;;] ./src/activations.c:79:5: warning: enumeration value βNORM_CHAN_SOFTMAXβ not handled in switch []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wswitch-Wswitch]8;;] ./src/activations.c:79:5: warning: enumeration value βNORM_CHAN_SOFTMAX_MAXVALβ not handled in switch []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wswitch-Wswitch]8;;] ./src/activations.c: In function βgradientβ: ./src/activations.c:310:5: warning: enumeration value βSWISHβ not handled in switch []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wswitch-Wswitch]8;;] 310 | switch(a){ | ^~~~~~ ./src/activations.c:310:5: warning: enumeration value βMISHβ not handled in switch []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wswitch-Wswitch]8;;] ./src/activations.c:310:5: warning: enumeration value βHARD_MISHβ not handled in switch []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wswitch-Wswitch]8;;] gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/im2col.c -o obj/im2col.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/col2im.c -o obj/col2im.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/blas.c -o obj/blas.o ./src/blas.c: In function βbackward_shortcut_multilayer_cpuβ: ./src/blas.c:207:21: warning: unused variable βout_indexβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 207 | int out_index = id; | ^~~~~~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/crop_layer.c -o obj/crop_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/dropout_layer.c -o obj/dropout_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/maxpool_layer.c -o obj/maxpool_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/softmax_layer.c -o obj/softmax_layer.o ./src/softmax_layer.c: In function βforward_contrastive_layerβ: ./src/softmax_layer.c:242:27: warning: variable βmax_truthβ set but not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-but-set-variable-Wunused-but-set-variable]8;;] 242 | float max_truth = 0; | ^~~~~~~~~ ./src/softmax_layer.c:421:71: warning: format β%dβ expects argument of type βintβ, but argument 2 has type βsize_tβ {aka βlong unsigned intβ} []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat=-Wformat=]8;;] 421 | printf(" Error: too large number of bboxes: contr_size = %d > max_contr_size = %d \n", contr_size, max_contr_size); | ~^ ~~~~~~~~~~ | | | | int size_t {aka long unsigned int} | %ld gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/data.c -o obj/data.o ./src/data.c: In function βload_data_detectionβ: ./src/data.c:1289:24: warning: unused variable βxβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1289 | int k, x, y; | ^ ./src/data.c:1076:43: warning: variable βr_scaleβ set but not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-but-set-variable-Wunused-but-set-variable]8;;] 1076 | float r1 = 0, r2 = 0, r3 = 0, r4 = 0, r_scale = 0; | ^~~~~~~ ./src/data.c: In function βfill_truth_detectionβ: ./src/data.c:431:33: warning: β%sβ directive writing up to 4095 bytes into a region of size 251 []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-overflow=-Wformat-overflow=]8;;] 431 | sprintf(buff, "echo %s \"Wrong annotation: w = %f\" >> bad_label.list", labelpath, w); | ^~ ~~~~~~~~~ ./src/data.c:431:27: note: assuming directive output of 8 bytes 431 | sprintf(buff, "echo %s \"Wrong annotation: w = %f\" >> bad_label.list", labelpath, w); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/stdio.h:894, from include/darknet.h:13, from ./src/data.h:5, from ./src/data.c:1: /usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: β__builtin___sprintf_chkβ output between 52 and 4461 bytes into a destination of size 256 38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ ./src/data.c:437:33: warning: β%sβ directive writing up to 4095 bytes into a region of size 251 []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-overflow=-Wformat-overflow=]8;;] 437 | sprintf(buff, "echo %s \"Wrong annotation: h = %f\" >> bad_label.list", labelpath, h); | ^~ ~~~~~~~~~ ./src/data.c:437:27: note: assuming directive output of 8 bytes 437 | sprintf(buff, "echo %s \"Wrong annotation: h = %f\" >> bad_label.list", labelpath, h); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/stdio.h:894, from include/darknet.h:13, from ./src/data.h:5, from ./src/data.c:1: /usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: β__builtin___sprintf_chkβ output between 52 and 4461 bytes into a destination of size 256 38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ ./src/data.c:424:33: warning: β%sβ directive writing up to 4095 bytes into a region of size 251 []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-overflow=-Wformat-overflow=]8;;] 424 | sprintf(buff, "echo %s \"Wrong annotation: x = %f, y = %f\" >> bad_label.list", labelpath, x, y); | ^~ ~~~~~~~~~ ./src/data.c:424:27: note: assuming directive output of 8 bytes 424 | sprintf(buff, "echo %s \"Wrong annotation: x = %f, y = %f\" >> bad_label.list", labelpath, x, y); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./src/data.c:424:27: note: assuming directive output of 8 bytes In file included from /usr/include/stdio.h:894, from include/darknet.h:13, from ./src/data.h:5, from ./src/data.c:1: /usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: β__builtin___sprintf_chkβ output between 61 and 4784 bytes into a destination of size 256 38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ ./src/data.c:417:33: warning: β%sβ directive writing up to 4095 bytes into a region of size 251 []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-overflow=-Wformat-overflow=]8;;] 417 | sprintf(buff, "echo %s \"Wrong annotation: x = 0 or y = 0\" >> bad_label.list", labelpath); | ^~ ~~~~~~~~~ In file included from /usr/include/stdio.h:894, from include/darknet.h:13, from ./src/data.h:5, from ./src/data.c:1: /usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: β__builtin___sprintf_chkβ output between 59 and 4154 bytes into a destination of size 256 38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ ./src/data.c:404:33: warning: β%sβ directive writing up to 4095 bytes into a region of size 251 []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-overflow=-Wformat-overflow=]8;;] 404 | sprintf(buff, "echo %s \"Wrong annotation: class_id = %d. But class_id should be [from 0 to %d]\" >> bad_label.list", labelpath, id, (classes-1)); | ^~ ~~~~~~~~~ In file included from /usr/include/stdio.h:894, from include/darknet.h:13, from ./src/data.h:5, from ./src/data.c:1: /usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: β__builtin___sprintf_chkβ output between 95 and 4210 bytes into a destination of size 256 38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/matrix.c -o obj/matrix.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/network.c -o obj/network.o ./src/network.c: In function βtrain_network_waitkeyβ: ./src/network.c:435:13: warning: unused variable βema_periodβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 435 | int ema_period = (net.max_batches - ema_start_point - 1000) * (1.0 - net.ema_alpha); | ^~~~~~~~~~ ./src/network.c: In function βresize_networkβ: ./src/network.c:660:42: warning: passing argument 1 of βcudaHostAllocβ from incompatible pointer type []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Wincompatible-pointer-types]8;;] 660 | if (cudaSuccess == cudaHostAlloc(&net->input_pinned_cpu, size * sizeof(float), cudaHostRegisterMapped)) | ^~~~~~~~~~~~~~~~~~~~~~ | | | float ** In file included from /usr/local/cuda/include/cuda_runtime.h:95, from include/darknet.h:41, from ./src/network.c:1: /usr/local/cuda/include/cuda_runtime_api.h:5331:60: note: expected βvoid **β but argument is of type βfloat **β 5331 | extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void **pHost, size_t size, unsigned int flags); | ~~~~~~~^~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/connected_layer.c -o obj/connected_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/cost_layer.c -o obj/cost_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/parser.c -o obj/parser.o ./src/parser.c: In function βparse_network_cfg_customβ: ./src/parser.c:1761:42: warning: passing argument 1 of βcudaHostAllocβ from incompatible pointer type []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Wincompatible-pointer-types]8;;] 1761 | if (cudaSuccess == cudaHostAlloc(&net.input_pinned_cpu, size * sizeof(float), cudaHostRegisterMapped)) net.input_pinned_cpu_flag = 1; | ^~~~~~~~~~~~~~~~~~~~~ | | | float ** In file included from /usr/local/cuda/include/cuda_runtime.h:95, from include/darknet.h:41, from ./src/activations.h:3, from ./src/activation_layer.h:4, from ./src/parser.c:6: /usr/local/cuda/include/cuda_runtime_api.h:5331:60: note: expected βvoid **β but argument is of type βfloat **β 5331 | extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void **pHost, size_t size, unsigned int flags); | ~~~~~~~^~~~~ ./src/parser.c: In function βsave_implicit_weightsβ: ./src/parser.c:1893:9: warning: unused variable βiβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1893 | int i; | ^ ./src/parser.c: In function βget_classes_multipliersβ: ./src/parser.c:435:40: warning: argument 1 range [18446744071562067968, 18446744073709551615] exceeds maximum object size 9223372036854775807 []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Walloc-size-larger-than=-Walloc-size-larger-than=]8;;] 435 | classes_multipliers = (float *)calloc(classes_counters, sizeof(float)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ./src/parser.c:3: /usr/include/stdlib.h:543:14: note: in a call to allocation function βcallocβ declared here 543 | extern void *calloc (size_t __nmemb, size_t __size) | ^~~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/option_list.c -o obj/option_list.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/darknet.c -o obj/darknet.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/detection_layer.c -o obj/detection_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/captcha.c -o obj/captcha.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/route_layer.c -o obj/route_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/writing.c -o obj/writing.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/box.c -o obj/box.o ./src/box.c: In function βbox_iou_kindβ: ./src/box.c:154:5: warning: enumeration value βMSEβ not handled in switch []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wswitch-Wswitch]8;;] 154 | switch(iou_kind) { | ^~~~~~ ./src/box.c: In function βdiounms_sortβ: ./src/box.c:898:27: warning: unused variable βbeta_probβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 898 | float beta_prob = pow(dets[j].prob[k], 2) / sum_prob; | ^~~~~~~~~ ./src/box.c:897:27: warning: unused variable βalpha_probβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 897 | float alpha_prob = pow(dets[i].prob[k], 2) / sum_prob; | ^~~~~~~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/nightmare.c -o obj/nightmare.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/normalization_layer.c -o obj/normalization_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/avgpool_layer.c -o obj/avgpool_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/coco.c -o obj/coco.o ./src/coco.c: In function βvalidate_coco_recallβ: ./src/coco.c:248:11: warning: unused variable βbaseβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 248 | char *base = "results/comp4_det_test_"; | ^~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/dice.c -o obj/dice.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/yolo.c -o obj/yolo.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/detector.c -o obj/detector.o ./src/detector.c: In function βeliminate_bddβ: ./src/detector.c:585:21: warning: statement with no effect []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-value-Wunused-value]8;;] 585 | for (k; buf[k + n] != '\0'; k++) | ^~~ ./src/detector.c: In function βvalidate_detectorβ: ./src/detector.c:706:13: warning: unused variable βmkd2β []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 706 | int mkd2 = make_directory(buff2, 0777); | ^~~~ ./src/detector.c:704:13: warning: unused variable βmkdβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 704 | int mkd = make_directory(buff, 0777); | ^~~ ./src/detector.c: In function βvalidate_detector_mapβ: ./src/detector.c:1323:24: warning: variable βcur_probβ set but not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-but-set-variable-Wunused-but-set-variable]8;;] 1323 | double cur_prob = 0; | ^~~~~~~~ ./src/detector.c:1344:15: warning: unused variable βclass_recallβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1344 | float class_recall = (float)tp_for_thresh_per_class[i] / ((float)tp_for_thresh_per_class[i] + (float)(truth_classes_count[i] - tp_for_thresh_per_class[i])); | ^~~~~~~~~~~~ ./src/detector.c:1343:15: warning: unused variable βclass_precisionβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1343 | float class_precision = (float)tp_for_thresh_per_class[i] / ((float)tp_for_thresh_per_class[i] + (float)fp_for_thresh_per_class[i]); | ^~~~~~~~~~~~~~~ ./src/detector.c: In function βdraw_objectβ: ./src/detector.c:1872:19: warning: unused variable βinv_lossβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1872 | float inv_loss = 1.0 / max_val_cmp(0.01, avg_loss); | ^~~~~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/layer.c -o obj/layer.o ./src/layer.c: In function βfree_layer_customβ: ./src/layer.c:208:68: warning: suggest parentheses around β&&β within β||β []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wparentheses-Wparentheses]8;;] 208 | if (l.delta_gpu && (l.optimized_memory < 1 || l.keep_delta_gpu && l.optimized_memory < 3)) cuda_free(l.delta_gpu), l.delta_gpu = NULL; | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/compare.c -o obj/compare.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/classifier.c -o obj/classifier.o ./src/classifier.c: In function βtrain_classifierβ: ./src/classifier.c:146:9: warning: unused variable βcountβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 146 | int count = 0; | ^~~~~ ./src/classifier.c: In function βpredict_classifierβ: ./src/classifier.c:855:13: warning: unused variable βtimeβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 855 | clock_t time; | ^~~~ ./src/classifier.c: In function βdemo_classifierβ: ./src/classifier.c:1283:49: warning: unused variable βtval_resultβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1283 | struct timeval tval_before, tval_after, tval_result; | ^~~~~~~~~~~ ./src/classifier.c:1283:37: warning: unused variable βtval_afterβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 1283 | struct timeval tval_before, tval_after, tval_result; | ^~~~~~~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/local_layer.c -o obj/local_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/swag.c -o obj/swag.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/shortcut_layer.c -o obj/shortcut_layer.o ./src/shortcut_layer.c: In function βmake_shortcut_layerβ: ./src/shortcut_layer.c:55:15: warning: unused variable βscaleβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 55 | float scale = sqrt(2. / l.nweights); | ^~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/representation_layer.c -o obj/representation_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/activation_layer.c -o obj/activation_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/rnn_layer.c -o obj/rnn_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/gru_layer.c -o obj/gru_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/rnn.c -o obj/rnn.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/rnn_vid.c -o obj/rnn_vid.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/crnn_layer.c -o obj/crnn_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/demo.c -o obj/demo.o ./src/demo.c: In function βdetect_in_threadβ: ./src/demo.c:100:15: warning: unused variable βlβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 100 | layer l = net.layers[net.n - 1]; | ^ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/tag.c -o obj/tag.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/cifar.c -o obj/cifar.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/go.c -o obj/go.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/batchnorm_layer.c -o obj/batchnorm_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/art.c -o obj/art.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/region_layer.c -o obj/region_layer.o ./src/region_layer.c: In function βresize_region_layerβ: ./src/region_layer.c:63:9: warning: unused variable βold_hβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 63 | int old_h = l->h; | ^~~~~ ./src/region_layer.c:62:9: warning: unused variable βold_wβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 62 | int old_w = l->w; | ^~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/reorg_layer.c -o obj/reorg_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/reorg_old_layer.c -o obj/reorg_old_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/super.c -o obj/super.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/voxel.c -o obj/voxel.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/tree.c -o obj/tree.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/yolo_layer.c -o obj/yolo_layer.o ./src/yolo_layer.c: In function βmake_yolo_layerβ: ./src/yolo_layer.c:66:38: warning: passing argument 1 of βcudaHostAllocβ from incompatible pointer type []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Wincompatible-pointer-types]8;;] 66 | if (cudaSuccess == cudaHostAlloc(&l.output, batch*l.outputs*sizeof(float), cudaHostRegisterMapped)) l.output_pinned = 1; | ^~~~~~~~~ | | | float ** In file included from /usr/local/cuda/include/cuda_runtime.h:95, from include/darknet.h:41, from ./src/activations.h:3, from ./src/layer.h:4, from ./src/yolo_layer.h:5, from ./src/yolo_layer.c:1: /usr/local/cuda/include/cuda_runtime_api.h:5331:60: note: expected βvoid **β but argument is of type βfloat **β 5331 | extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void **pHost, size_t size, unsigned int flags); | ~~~~~~~^~~~~ ./src/yolo_layer.c:73:38: warning: passing argument 1 of βcudaHostAllocβ from incompatible pointer type []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Wincompatible-pointer-types]8;;] 73 | if (cudaSuccess == cudaHostAlloc(&l.delta, batch*l.outputs*sizeof(float), cudaHostRegisterMapped)) l.delta_pinned = 1; | ^~~~~~~~ | | | float ** In file included from /usr/local/cuda/include/cuda_runtime.h:95, from include/darknet.h:41, from ./src/activations.h:3, from ./src/layer.h:4, from ./src/yolo_layer.h:5, from ./src/yolo_layer.c:1: /usr/local/cuda/include/cuda_runtime_api.h:5331:60: note: expected βvoid **β but argument is of type βfloat **β 5331 | extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void **pHost, size_t size, unsigned int flags); | ~~~~~~~^~~~~ ./src/yolo_layer.c: In function βresize_yolo_layerβ: ./src/yolo_layer.c:104:42: warning: passing argument 1 of βcudaHostAllocβ from incompatible pointer type []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Wincompatible-pointer-types]8;;] 104 | if (cudaSuccess != cudaHostAlloc(&l->output, l->batch*l->outputs * sizeof(float), cudaHostRegisterMapped)) { | ^~~~~~~~~~ | | | float ** In file included from /usr/local/cuda/include/cuda_runtime.h:95, from include/darknet.h:41, from ./src/activations.h:3, from ./src/layer.h:4, from ./src/yolo_layer.h:5, from ./src/yolo_layer.c:1: /usr/local/cuda/include/cuda_runtime_api.h:5331:60: note: expected βvoid **β but argument is of type βfloat **β 5331 | extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void **pHost, size_t size, unsigned int flags); | ~~~~~~~^~~~~ ./src/yolo_layer.c:113:42: warning: passing argument 1 of βcudaHostAllocβ from incompatible pointer type []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Wincompatible-pointer-types]8;;] 113 | if (cudaSuccess != cudaHostAlloc(&l->delta, l->batch*l->outputs * sizeof(float), cudaHostRegisterMapped)) { | ^~~~~~~~~ | | | float ** In file included from /usr/local/cuda/include/cuda_runtime.h:95, from include/darknet.h:41, from ./src/activations.h:3, from ./src/layer.h:4, from ./src/yolo_layer.h:5, from ./src/yolo_layer.c:1: /usr/local/cuda/include/cuda_runtime_api.h:5331:60: note: expected βvoid **β but argument is of type βfloat **β 5331 | extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void **pHost, size_t size, unsigned int flags); | ~~~~~~~^~~~~ ./src/yolo_layer.c: In function βprocess_batchβ: ./src/yolo_layer.c:424:25: warning: variable βbest_match_tβ set but not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-but-set-variable-Wunused-but-set-variable]8;;] 424 | int best_match_t = 0; | ^~~~~~~~~~~~ ./src/yolo_layer.c: In function βforward_yolo_layerβ: ./src/yolo_layer.c:704:11: warning: unused variable βavg_anyobjβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 704 | float avg_anyobj = 0; | ^~~~~~~~~~ ./src/yolo_layer.c:703:11: warning: unused variable βavg_objβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 703 | float avg_obj = 0; | ^~~~~~~ ./src/yolo_layer.c:702:11: warning: unused variable βavg_catβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 702 | float avg_cat = 0; | ^~~~~~~ ./src/yolo_layer.c:701:11: warning: unused variable βrecall75β []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 701 | float recall75 = 0; | ^~~~~~~~ ./src/yolo_layer.c:700:11: warning: unused variable βrecallβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 700 | float recall = 0; | ^~~~~~ ./src/yolo_layer.c:699:11: warning: unused variable βtot_ciou_lossβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 699 | float tot_ciou_loss = 0; | ^~~~~~~~~~~~~ ./src/yolo_layer.c:698:11: warning: unused variable βtot_diou_lossβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 698 | float tot_diou_loss = 0; | ^~~~~~~~~~~~~ ./src/yolo_layer.c:695:11: warning: unused variable βtot_ciouβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 695 | float tot_ciou = 0; | ^~~~~~~~ ./src/yolo_layer.c:694:11: warning: unused variable βtot_diouβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 694 | float tot_diou = 0; | ^~~~~~~~ ./src/yolo_layer.c:693:11: warning: unused variable βtot_giouβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 693 | float tot_giou = 0; | ^~~~~~~~ ./src/yolo_layer.c:665:12: warning: unused variable βnβ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable]8;;] 665 | int b, n; | ^ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/gaussian_yolo_layer.c -o obj/gaussian_yolo_layer.o ./src/gaussian_yolo_layer.c: In function βmake_gaussian_yolo_layerβ: ./src/gaussian_yolo_layer.c:70:38: warning: passing argument 1 of βcudaHostAllocβ from incompatible pointer type []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Wincompatible-pointer-types]8;;] 70 | if (cudaSuccess == cudaHostAlloc(&l.output, batch*l.outputs * sizeof(float), cudaHostRegisterMapped)) l.output_pinned = 1; | ^~~~~~~~~ | | | float ** In file included from /usr/local/cuda/include/cuda_runtime.h:95, from include/darknet.h:41, from ./src/gaussian_yolo_layer.h:5, from ./src/gaussian_yolo_layer.c:7: /usr/local/cuda/include/cuda_runtime_api.h:5331:60: note: expected βvoid **β but argument is of type βfloat **β 5331 | extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void **pHost, size_t size, unsigned int flags); | ~~~~~~~^~~~~ ./src/gaussian_yolo_layer.c:77:38: warning: passing argument 1 of βcudaHostAllocβ from incompatible pointer type []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Wincompatible-pointer-types]8;;] 77 | if (cudaSuccess == cudaHostAlloc(&l.delta, batch*l.outputs * sizeof(float), cudaHostRegisterMapped)) l.delta_pinned = 1; | ^~~~~~~~ | | | float ** In file included from /usr/local/cuda/include/cuda_runtime.h:95, from include/darknet.h:41, from ./src/gaussian_yolo_layer.h:5, from ./src/gaussian_yolo_layer.c:7: /usr/local/cuda/include/cuda_runtime_api.h:5331:60: note: expected βvoid **β but argument is of type βfloat **β 5331 | extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void **pHost, size_t size, unsigned int flags); | ~~~~~~~^~~~~ ./src/gaussian_yolo_layer.c: In function βresize_gaussian_yolo_layerβ: ./src/gaussian_yolo_layer.c:109:42: warning: passing argument 1 of βcudaHostAllocβ from incompatible pointer type []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Wincompatible-pointer-types]8;;] 109 | if (cudaSuccess != cudaHostAlloc(&l->output, l->batch*l->outputs * sizeof(float), cudaHostRegisterMapped)) { | ^~~~~~~~~~ | | | float ** In file included from /usr/local/cuda/include/cuda_runtime.h:95, from include/darknet.h:41, from ./src/gaussian_yolo_layer.h:5, from ./src/gaussian_yolo_layer.c:7: /usr/local/cuda/include/cuda_runtime_api.h:5331:60: note: expected βvoid **β but argument is of type βfloat **β 5331 | extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void **pHost, size_t size, unsigned int flags); | ~~~~~~~^~~~~ ./src/gaussian_yolo_layer.c:118:42: warning: passing argument 1 of βcudaHostAllocβ from incompatible pointer type []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Wincompatible-pointer-types]8;;] 118 | if (cudaSuccess != cudaHostAlloc(&l->delta, l->batch*l->outputs * sizeof(float), cudaHostRegisterMapped)) { | ^~~~~~~~~ | | | float ** In file included from /usr/local/cuda/include/cuda_runtime.h:95, from include/darknet.h:41, from ./src/gaussian_yolo_layer.h:5, from ./src/gaussian_yolo_layer.c:7: /usr/local/cuda/include/cuda_runtime_api.h:5331:60: note: expected βvoid **β but argument is of type βfloat **β 5331 | extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void **pHost, size_t size, unsigned int flags); | ~~~~~~~^~~~~ gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/upsample_layer.c -o obj/upsample_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/lstm_layer.c -o obj/lstm_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/conv_lstm_layer.c -o obj/conv_lstm_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/scale_channels_layer.c -o obj/scale_channels_layer.o gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU -c ./src/sam_layer.c -o obj/sam_layer.o nvcc -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU" -c ./src/convolutional_kernels.cu -o obj/convolutional_kernels.o nvcc -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU" -c ./src/activation_kernels.cu -o obj/activation_kernels.o nvcc -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU" -c ./src/im2col_kernels.cu -o obj/im2col_kernels.o nvcc -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU" -c ./src/col2im_kernels.cu -o obj/col2im_kernels.o nvcc -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU" -c ./src/blas_kernels.cu -o obj/blas_kernels.o nvcc -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU" -c ./src/crop_layer_kernels.cu -o obj/crop_layer_kernels.o nvcc -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU" -c ./src/dropout_layer_kernels.cu -o obj/dropout_layer_kernels.o nvcc -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU" -c ./src/maxpool_layer_kernels.cu -o obj/maxpool_layer_kernels.o nvcc -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU" -c ./src/network_kernels.cu -o obj/network_kernels.o nvcc -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU" -c ./src/avgpool_layer_kernels.cu -o obj/avgpool_layer_kernels.o g++ -std=c++11 -std=c++11 -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -rdynamic -Ofast -DOPENCV -DGPU obj/image_opencv.o obj/http_stream.o obj/gemm.o obj/utils.o obj/dark_cuda.o obj/convolutional_layer.o obj/list.o obj/image.o obj/activations.o obj/im2col.o obj/col2im.o obj/blas.o obj/crop_layer.o obj/dropout_layer.o obj/maxpool_layer.o obj/softmax_layer.o obj/data.o obj/matrix.o obj/network.o obj/connected_layer.o obj/cost_layer.o obj/parser.o obj/option_list.o obj/darknet.o obj/detection_layer.o obj/captcha.o obj/route_layer.o obj/writing.o obj/box.o obj/nightmare.o obj/normalization_layer.o obj/avgpool_layer.o obj/coco.o obj/dice.o obj/yolo.o obj/detector.o obj/layer.o obj/compare.o obj/classifier.o obj/local_layer.o obj/swag.o obj/shortcut_layer.o obj/representation_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/rnn.o obj/rnn_vid.o obj/crnn_layer.o obj/demo.o obj/tag.o obj/cifar.o obj/go.o obj/batchnorm_layer.o obj/art.o obj/region_layer.o obj/reorg_layer.o obj/reorg_old_layer.o obj/super.o obj/voxel.o obj/tree.o obj/yolo_layer.o obj/gaussian_yolo_layer.o obj/upsample_layer.o obj/lstm_layer.o obj/conv_lstm_layer.o obj/scale_channels_layer.o obj/sam_layer.o obj/convolutional_kernels.o obj/activation_kernels.o obj/im2col_kernels.o obj/col2im_kernels.o obj/blas_kernels.o obj/crop_layer_kernels.o obj/dropout_layer_kernels.o obj/maxpool_layer_kernels.o obj/network_kernels.o obj/avgpool_layer_kernels.o -o darknet -lm -pthread `pkg-config --libs opencv4 2> /dev/null || pkg-config --libs opencv` -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -lstdc++ --2024-04-15 00:35:09-- https://pjreddie.com/media/files/yolov3.weights Resolving pjreddie.com (pjreddie.com)... 162.0.215.52 Connecting to pjreddie.com (pjreddie.com)|162.0.215.52|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 248007048 (237M) [application/octet-stream] Saving to: βyolov3.weights.1β yolov3.weights.1 100%[===================>] 236.52M 41.1MB/s in 6.0s 2024-04-15 00:35:16 (39.1 MB/s) - βyolov3.weights.1β saved [248007048/248007048] --2024-04-15 00:35:16-- https://pjreddie.com/media/files/yolov2.weights Resolving pjreddie.com (pjreddie.com)... 162.0.215.52 Connecting to pjreddie.com (pjreddie.com)|162.0.215.52|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 203934260 (194M) [application/octet-stream] Saving to: βyolov2.weights.1β yolov2.weights.1 100%[===================>] 194.49M 36.0MB/s in 5.6s 2024-04-15 00:35:22 (34.5 MB/s) - βyolov2.weights.1β saved [203934260/203934260] File βyolov3.weightsβ already there; not retrieving. File βyolov2.weightsβ already there; not retrieving. CUDA-version: 12020 (12020), GPU count: 1 OpenCV version: 4.5.4 0 : compute_capability = 750, cudnn_half = 0, GPU: Tesla T4 net.optimized_memory = 0 mini_batch = 1, batch = 1, time_steps = 1, train = 0 layer filters size/strd(dil) input output 0 Create CUDA-stream - 0 conv 32 3 x 3/ 1 416 x 416 x 3 -> 416 x 416 x 32 0.299 BF 1 conv 64 3 x 3/ 2 416 x 416 x 32 -> 208 x 208 x 64 1.595 BF 2 conv 32 1 x 1/ 1 208 x 208 x 64 -> 208 x 208 x 32 0.177 BF 3 conv 64 3 x 3/ 1 208 x 208 x 32 -> 208 x 208 x 64 1.595 BF 4 Shortcut Layer: 1, wt = 0, wn = 0, outputs: 208 x 208 x 64 0.003 BF 5 conv 128 3 x 3/ 2 208 x 208 x 64 -> 104 x 104 x 128 1.595 BF 6 conv 64 1 x 1/ 1 104 x 104 x 128 -> 104 x 104 x 64 0.177 BF 7 conv 128 3 x 3/ 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BF 8 Shortcut Layer: 5, wt = 0, wn = 0, outputs: 104 x 104 x 128 0.001 BF 9 conv 64 1 x 1/ 1 104 x 104 x 128 -> 104 x 104 x 64 0.177 BF 10 conv 128 3 x 3/ 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BF 11 Shortcut Layer: 8, wt = 0, wn = 0, outputs: 104 x 104 x 128 0.001 BF 12 conv 256 3 x 3/ 2 104 x 104 x 128 -> 52 x 52 x 256 1.595 BF 13 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF 14 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 15 Shortcut Layer: 12, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF 16 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF 17 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 18 Shortcut Layer: 15, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF 19 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF 20 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 21 Shortcut Layer: 18, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF 22 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF 23 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 24 Shortcut Layer: 21, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF 25 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF 26 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 27 Shortcut Layer: 24, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF 28 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF 29 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 30 Shortcut Layer: 27, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF 31 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF 32 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 33 Shortcut Layer: 30, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF 34 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF 35 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 36 Shortcut Layer: 33, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF 37 conv 512 3 x 3/ 2 52 x 52 x 256 -> 26 x 26 x 512 1.595 BF 38 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF 39 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 40 Shortcut Layer: 37, wt = 0, wn = 0, outputs: 26 x 26 x 512 0.000 BF 41 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF 42 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 43 Shortcut Layer: 40, wt = 0, wn = 0, outputs: 26 x 26 x 512 0.000 BF 44 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF 45 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 46 Shortcut Layer: 43, wt = 0, wn = 0, outputs: 26 x 26 x 512 0.000 BF 47 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF 48 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 49 Shortcut Layer: 46, wt = 0, wn = 0, outputs: 26 x 26 x 512 0.000 BF 50 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF 51 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 52 Shortcut Layer: 49, wt = 0, wn = 0, outputs: 26 x 26 x 512 0.000 BF 53 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF 54 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 55 Shortcut Layer: 52, wt = 0, wn = 0, outputs: 26 x 26 x 512 0.000 BF 56 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF 57 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 58 Shortcut Layer: 55, wt = 0, wn = 0, outputs: 26 x 26 x 512 0.000 BF 59 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF 60 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 61 Shortcut Layer: 58, wt = 0, wn = 0, outputs: 26 x 26 x 512 0.000 BF 62 conv 1024 3 x 3/ 2 26 x 26 x 512 -> 13 x 13 x1024 1.595 BF 63 conv 512 1 x 1/ 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF 64 conv 1024 3 x 3/ 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF 65 Shortcut Layer: 62, wt = 0, wn = 0, outputs: 13 x 13 x1024 0.000 BF 66 conv 512 1 x 1/ 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF 67 conv 1024 3 x 3/ 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF 68 Shortcut Layer: 65, wt = 0, wn = 0, outputs: 13 x 13 x1024 0.000 BF 69 conv 512 1 x 1/ 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF 70 conv 1024 3 x 3/ 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF 71 Shortcut Layer: 68, wt = 0, wn = 0, outputs: 13 x 13 x1024 0.000 BF 72 conv 512 1 x 1/ 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF 73 conv 1024 3 x 3/ 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF 74 Shortcut Layer: 71, wt = 0, wn = 0, outputs: 13 x 13 x1024 0.000 BF 75 conv 512 1 x 1/ 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF 76 conv 1024 3 x 3/ 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF 77 conv 512 1 x 1/ 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF 78 conv 1024 3 x 3/ 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF 79 conv 512 1 x 1/ 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF 80 conv 1024 3 x 3/ 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF 81 conv 255 1 x 1/ 1 13 x 13 x1024 -> 13 x 13 x 255 0.088 BF 82 yolo [yolo] params: iou loss: mse (2), iou_norm: 0.75, obj_norm: 1.00, cls_norm: 1.00, delta_norm: 1.00, scale_x_y: 1.00 83 route 79 -> 13 x 13 x 512 84 conv 256 1 x 1/ 1 13 x 13 x 512 -> 13 x 13 x 256 0.044 BF 85 upsample 2x 13 x 13 x 256 -> 26 x 26 x 256 86 route 85 61 -> 26 x 26 x 768 87 conv 256 1 x 1/ 1 26 x 26 x 768 -> 26 x 26 x 256 0.266 BF 88 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 89 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF 90 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 91 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF 92 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 93 conv 255 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 255 0.177 BF 94 yolo [yolo] params: iou loss: mse (2), iou_norm: 0.75, obj_norm: 1.00, cls_norm: 1.00, delta_norm: 1.00, scale_x_y: 1.00 95 route 91 -> 26 x 26 x 256 96 conv 128 1 x 1/ 1 26 x 26 x 256 -> 26 x 26 x 128 0.044 BF 97 upsample 2x 26 x 26 x 128 -> 52 x 52 x 128 98 route 97 36 -> 52 x 52 x 384 99 conv 128 1 x 1/ 1 52 x 52 x 384 -> 52 x 52 x 128 0.266 BF 100 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 101 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF 102 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 103 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF 104 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 105 conv 255 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 255 0.353 BF 106 yolo [yolo] params: iou loss: mse (2), iou_norm: 0.75, obj_norm: 1.00, cls_norm: 1.00, delta_norm: 1.00, scale_x_y: 1.00 Total BFLOPS 65.879 avg_outputs = 532444 Allocate additional workspace_size = 49.84 MB Loading weights from yolov3.weights... seen 64, trained: 32013 K-images (500 Kilo-batches_64) Done! Loaded 107 layers from weights-file Detection layer: 82 - type = 28 Detection layer: 94 - type = 28 Detection layer: 106 - type = 28 /content/bolivia-EAAS0224_trip7.jpg: Predicted in 70.324000 milli-seconds. person: 100% person: 100% person: 55% person: 59% person: 37% person: 45% OpenCV exception: show_image_cv CUDA-version: 12020 (12020), GPU count: 1 OpenCV version: 4.5.4 0 : compute_capability = 750, cudnn_half = 0, GPU: Tesla T4 net.optimized_memory = 0 mini_batch = 1, batch = 1, time_steps = 1, train = 0 layer filters size/strd(dil) input output 0 Create CUDA-stream - 0 conv 32 3 x 3/ 1 416 x 416 x 3 -> 416 x 416 x 32 0.299 BF 1 max 2x 2/ 2 416 x 416 x 32 -> 208 x 208 x 32 0.006 BF 2 conv 64 3 x 3/ 1 208 x 208 x 32 -> 208 x 208 x 64 1.595 BF 3 max 2x 2/ 2 208 x 208 x 64 -> 104 x 104 x 64 0.003 BF 4 conv 128 3 x 3/ 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BF 5 conv 64 1 x 1/ 1 104 x 104 x 128 -> 104 x 104 x 64 0.177 BF 6 conv 128 3 x 3/ 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BF 7 max 2x 2/ 2 104 x 104 x 128 -> 52 x 52 x 128 0.001 BF 8 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 9 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF 10 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF 11 max 2x 2/ 2 52 x 52 x 256 -> 26 x 26 x 256 0.001 BF 12 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 13 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF 14 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 15 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF 16 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF 17 max 2x 2/ 2 26 x 26 x 512 -> 13 x 13 x 512 0.000 BF 18 conv 1024 3 x 3/ 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF 19 conv 512 1 x 1/ 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF 20 conv 1024 3 x 3/ 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF 21 conv 512 1 x 1/ 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF 22 conv 1024 3 x 3/ 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF 23 conv 1024 3 x 3/ 1 13 x 13 x1024 -> 13 x 13 x1024 3.190 BF 24 conv 1024 3 x 3/ 1 13 x 13 x1024 -> 13 x 13 x1024 3.190 BF 25 route 16 -> 26 x 26 x 512 26 conv 64 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 64 0.044 BF 27 reorg_old reorg_old / 2 26 x 26 x 64 -> 13 x 13 x 256 28 route 27 24 -> 13 x 13 x1280 29 conv 1024 3 x 3/ 1 13 x 13 x1280 -> 13 x 13 x1024 3.987 BF 30 conv 425 1 x 1/ 1 13 x 13 x1024 -> 13 x 13 x 425 0.147 BF 31 detection mask_scale: Using default '1.000000' Total BFLOPS 29.475 avg_outputs = 611537 Allocate additional workspace_size = 49.84 MB Loading weights from yolov2.weights... seen 32, trained: 32013 K-images (500 Kilo-batches_64) Done! Loaded 32 layers from weights-file Detection layer: 31 - type = 27 /content/bolivia-EAAS0224_trip7.jpg: Predicted in 50.308000 milli-seconds. person: 77% person: 65% OpenCV exception: show_image_cv
PVT - Pyramid Vision Transformer
PVT has several merits compared to current state of the arts.
(1) Different from ViT that typically yields low- resolution outputs and incurs high computational and memory costs, PVT not only can be trained on dense partitions of an image to achieve high output resolution, which is important for dense prediction, but also uses a progressive shrinking pyramid to reduce the computations of large feature maps.
(2) PVT inherits the advantages of both CNN and Transformer, making it a unified backbone for various vision tasks without convolutions, where it can be used as a direct replacement for CNN backbones.
from transformers import PvtImageProcessor, PvtForImageClassification
from PIL import Image
import requests
import matplotlib.pyplot as plt
url = 'http://images.cocodataset.org/val2017/000000015272.jpg'
image = Image.open(requests.get(url, stream=True).raw)
processor = PvtImageProcessor.from_pretrained('Zetatech/pvt-tiny-224')
model = PvtForImageClassification.from_pretrained('Zetatech/pvt-tiny-224')
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
# model predicts one of the 1000 ImageNet classes
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])
predicted_label = logits.argmax(-1).item()
plt.imshow(image)
plt.axis('off')
plt.show()
Predicted class: traffic light, traffic signal, stoplight
ReferencesΒΆ
Dosovitskiy, Alexey, et al. "An image is worth 16x16 words: Transformers for image recognition at scale." arXiv preprint arXiv:2010.11929 (2020).
Lin, Tsung-Yi, et al. "Feature pyramid networks for object detection." Proceedings of the IEEE conference on computer vision and pattern recognition. 2017.
Lowe, David G. "Object recognition from local scale-invariant features." Proceedings of the seventh IEEE international conference on computer vision. Vol. 2. Ieee, 1999.
Redmon, Joseph, and Ali Farhadi. "Yolov3: An incremental improvement." arXiv preprint arXiv:1804.02767 (2018).
Szeliski, Richard. Computer vision: algorithms and applications. Springer Nature, 2022.
Wang, Wenhai, et al. "Pyramid vision transformer: A versatile backbone for dense prediction without convolutions." Proceedings of the IEEE/CVF international conference on computer vision. 2021.